Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 5 - Menu Manager Reference / Menu Manager Functions
Manipulating and Accessing Menu Item Characteristics /


SetMenuItemIconHandle

NEW WITH THE APPEARANCE MANAGER

Sets a menu item's icon.

pascal OSErr SetMenuItemIconHandle (
                     MenuHandle inMenu,
                     SInt16 inItem,
                     MenuIconType inIconType,
                     Handle inIconHandle);
inMenu
The handle to the menu structure of the menu item for which you wish to set an icon.
inItem
An integer representing the item number of the menu item for which you wish to set an icon.
inIconType
The type of icon ('ICON', 'cicn', 'SICN', or icon suite) you wish to attach, as specified by a menu icon handle constant.
inIconHandle
The handle to the icon you wish to attach to a menu item.
function result
A result code; see "Result Codes".
DISCUSSION
The SetMenuItemIconHandle function sets the icon of a menu item with an icon handle instead of a resource ID. SetMenuItemIconHandle allows you to set icons of type 'ICON', 'cicn', 'SICN', as well as icon suites. To set resource-based icons for a menu item, call SetItemIcon.

WARNING
Disposing of the menu will not dispose of the icon handles set by this function. To prevent memory leaks, your application should dispose of the icons when you dispose of the menu.
SEE ALSO
"Appearance Manager Gestalt Selector Constants".

GetMenuItemIconHandle.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998